﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace WeatherStationSys.Interface
{
    /// <summary>
    /// 抽象的调度器
    /// </summary>
    public abstract class AbstractScheduler
    {
        /// <summary>
        /// 调度测试
        /// </summary>
        public static int TicCount = 0;

        public virtual void Tic()
        {
            //每1分钟读取温度(只是想改传感器的读取速率)
            if (TicCount % 6 == 0)
            {
                TemperatureSensor.Check();
            }

            //每5分钟读取气压(只是想改传感器的读取速率)
            if (TicCount % 30 == 0)
            {
                BarometricPressureSensor.Read();
            }
        }

        /// <summary>
        /// 某硬件平台温度传感器
        /// </summary>
        public AbstractTemperatureSensor _temperatureSensor;
        public AbstractTemperatureSensor TemperatureSensor
        {
            get { return _temperatureSensor; }
            set
            {
                _temperatureSensor = value;

            }
        }

        /// <summary>
        /// 某硬件平台气压传感器
        /// </summary>
        public AbstractBarometricPressureSensor _barometricPressureSensor;
        public AbstractBarometricPressureSensor BarometricPressureSensor
        {
            get { return _barometricPressureSensor; }
            set
            {
                _barometricPressureSensor = value;

            }
        }

        /// <summary>
        /// 某硬件平台风速传感器
        /// </summary>
    }
}
